//
//  TravelDetilCell.m
//  Travelmemory
//
//  Created by lanou3g on 16/3/26.
//  Copyright © 2016年 ABCD. All rights reserved.
//

#import "TravelDetilCell.h"
#define kScreenW self.contentView.frame.size.width
@implementation TravelDetilCell

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

   
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self setView];
        //self.contentView.backgroundColor = [UIColor grayColor];
    }
    return self;
}

- (void)setView {
    
    
    self.imageV = [[UIImageView alloc] init];
    
    self.imageV.frame = CGRectMake(0, 0, kScreenW, 100);

    self.imageV.layer.masksToBounds = YES;
    self.imageV.layer.cornerRadius = self.imageV.frame.size.width / 28;
    
    [self.contentView addSubview:self.imageV];
    
    self.contentLabel = [[UILabel alloc] init];
    self.contentLabel.frame = CGRectMake(0, CGRectGetMaxY(self.imageV.frame), kScreenW, 100);
   
    self.contentLabel.numberOfLines = 0;
    self.contentLabel.font = [UIFont systemFontOfSize:14];
    [self.contentView addSubview:self.contentLabel];
    
    self.timeImageV = [[UIImageView alloc] init];
    self.timeImageV.frame = CGRectMake(10, CGRectGetMaxY(self.contentLabel.frame), 20, 20);
  
    [self.contentView addSubview:self.timeImageV];
    
    self.timeLabel = [[UILabel alloc] init];
    self.timeLabel.frame = CGRectMake(CGRectGetMaxX(self.timeImageV.frame), CGRectGetMinY(self.timeImageV.frame), kScreenW * 0.3, 20);
  
    [self.contentView addSubview:self.timeLabel];
    
    self.addressButton = [UIButton buttonWithType:UIButtonTypeCustom];
    self.addressButton.frame = CGRectMake(CGRectGetMaxX(self.timeLabel.frame), CGRectGetMinY(self.timeLabel.frame), kScreenW * 0.6 - 20, 20);
  
    self.addressButton.titleLabel.font = [UIFont systemFontOfSize:14];
    self.addressButton.titleLabel.textAlignment = NSTextAlignmentRight;
    [self.addressButton setTitleColor:[UIColor grayColor] forState:UIControlStateNormal];
    [self.contentView addSubview:self.addressButton];
    
    self.contentView.backgroundColor = [UIColor colorWithRed:0.804 green:0.804 blue:0.714 alpha:1];
    
}

@end
